Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding HLS plugins for linear functions and cliffords #9399

Merged
merged 7 commits into from
Apr 5, 2023

Conversation

alexanderivrii
Copy link
Contributor

Summary

This commit adds the high-level-synthesis plugins for LinearFunction and Clifford, extending the set of plugins that can be called via HighLevelSynthesis transpiler pass.

This does not include any actual synthesis algorithms.

@alexanderivrii alexanderivrii added this to the 0.24.0 milestone Jan 20, 2023
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@coveralls
Copy link

coveralls commented Jan 20, 2023

Pull Request Test Coverage Report for Build 4616968912

  • 31 of 45 (68.89%) changed or added relevant lines in 1 file are covered.
  • 89 unchanged lines in 7 files lost coverage.
  • Overall coverage decreased (-0.02%) to 85.388%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/transpiler/passes/synthesis/high_level_synthesis.py 31 45 68.89%
Files with Coverage Reduction New Missed Lines %
qiskit/circuit/tools/pi_check.py 1 91.23%
qiskit/transpiler/passes/synthesis/high_level_synthesis.py 2 79.09%
qiskit/pulse/library/waveform.py 3 91.67%
qiskit/circuit/init.py 5 84.38%
crates/accelerate/src/vf2_layout.rs 8 86.44%
qiskit/circuit/quantumcircuitdata.py 11 88.18%
qiskit/circuit/quantumcircuit.py 59 94.19%
Totals Coverage Status
Change from base Build 4604440337: -0.02%
Covered Lines: 67475
Relevant Lines: 79022

💛 - Coveralls

@mtreinish mtreinish added the Changelog: New Feature Include in the "Added" section of the changelog label Jan 20, 2023
@alexanderivrii alexanderivrii changed the title Adding HLS plugins for linear functions and cliffods Adding HLS plugins for linear functions and cliffords Jan 23, 2023
Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this LGTM, it's simple and straightforward. The only thing missing is some documentation about how to use the new plugins. None of the docstrings and the release note doesn't actually map the method to the plugin name. I think it'd be good to document this so users know how to use these plugins.

Comment on lines 4 to 14
Added high-level-synthesis plugins for :class:`.LinearFunction` and for
:class:`qiskit.quantum_info.Clifford`, extending the set of synthesis
methods that can be called from :class:`~qiskit.transpiler.passes.HighLevelSynthesis`
transpiler pass.
For :class:`.LinearFunction` the newly available plugins are
:class:`.PMHSynthesisLinearFunction` and :class:`.KMSSynthesisLinearFunction`.
For :class:`qiskit.quantum_info.Clifford` the newly available plugins are
:class:`.AGSynthesisClifford`, :class:`.BMSynthesisClifford`,
:class:`.GreedySynthesisClifford` and :class:`.LayerSynthesisClifford`.
Please refer to :mod:`qiskit.synthesis` documentation for more information
about each individual method.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a table or something that maps the plugin names to the methods? I think that'll be good for users so they know what the plugin names are going to be. Also having an example of how to use it with transpile would go a long way too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0dbcf31.

class DefaultSynthesisLinearFunction(HighLevelSynthesisPlugin):
"""The default linear function synthesis plugin."""
class AGSynthesisClifford(HighLevelSynthesisPlugin):
"""Clifford synthesis plugin based on the Aaronson-Gottesman method."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be good to say explicitly in the docstring here (and for the other plugin classes) that the name of this plugin is "ag" so that users know how to specify the plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in a91f5d2.

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this LGTM, just one small suggestion inline about the wording in the docstring for the plugin classes (it applies to all of them, not just the one I left inline). When that's resolved I think we're good to go here.

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for all the updates

@mtreinish mtreinish added this pull request to the merge queue Apr 5, 2023
Merged via the queue into Qiskit:main with commit 625f3fc Apr 5, 2023
giacomoRanieri pushed a commit to giacomoRanieri/qiskit-terra that referenced this pull request Apr 16, 2023
* Adding barebone HLS plugins for linear functions and cliffods

* adding clifford.lnn method and improving docstrings

* improving release notes with table and example

* docstring improvements following review
king-p3nguin pushed a commit to king-p3nguin/qiskit-terra that referenced this pull request May 22, 2023
* Adding barebone HLS plugins for linear functions and cliffods

* adding clifford.lnn method and improving docstrings

* improving release notes with table and example

* docstring improvements following review
@alexanderivrii alexanderivrii deleted the more-hls-plugins branch October 23, 2023 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants